/*
 * staticObject.h
 *
 *  Created on: 17.05.2009
 *      Author: Christian Stupp
 */

#ifndef STATICOBJECT_H_
#define STATICOBJECT_H_

#include <string>
#include <map>
#include <stdlib.h>
#include "files.h"

namespace oal {

#define array_length(array) (sizeof (array) / sizeof (array)[0])

	class staticObject {
	private:
	public:
		static std::map<std::string, std::string> configuration;
		staticObject();
		virtual ~staticObject();
		static bool isSpace(int in);
		static std::string rtrim(std::string);
		static std::string ltrim(std::string);
		static std::string trim(std::string);
		static char charToLower(char newChar);
		static char charToUpper(char newChar);
		static std::string stringToLower(std::string newString);
		static std::string stringToUpper(std::string newString);
		static std::string implode(std::string sep, std::map<std::string,std::string> value);
		static std::map<std::string,std::string> explode(std::string sep, std::string value, std::string sep2="=");
		static std::vector<std::string> explodeInt(std::string sep, std::string value, int count=-1);
		static std::string stringReplace(std::string needle, std::string  replace, std::string content);
		static std::string searchInContentFor(
			std::string *content,
			std::string firstNeedle,
			std::string secondNeedle,
			std::string firstPosString = ""
		);
		static tm makeTimeStruct(std::string datum, std::string art="en");
		static std::string timestamp(std::string referenz="");
		static std::string loadFromFile(std::string fileName);
		static bool saveToFile(std::string fileName, std::string content);
		static bool parseConfiguration(std::string fileName, std::string linebreak = "\n",std::string seperator = ":");
		static std::vector<std::string> getOptionFromString(std::string options, int count=999);
		static string htmlEncode( const string& s );
		static string isLink(string path);
		static string filetime(string filename);
	};
};
#endif /* STATICOBJECT_H_ */
